package hanqi.rabbit;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


@Slf4j
@Component
public class MqListener {
    @Autowired
    LogService logService;
    @RabbitListener(queues = "netoru")
    public void listenmessage(String msg){

        System.out.println("get it~~"+msg);
        logService.saveLog(msg);
    }
}
